import java.util.Scanner;

//用户输入整数n，计算(1!)+   (1!+2!)+   (1!+2!+3!)+    …..+(1!+2!+…n!)
       // 用方法实现
       // 有参数有返回值
public class jiecheng {
    public static void main(String[] args) {
        Scanner JC = new Scanner(System.in);
        System.out.println("请用户输入整数：");
        int a = JC.nextInt();
        A(a);
    }

    static void A(int b) {
        for (int i = 1; i < b + 1; i++) {
            System.out.print("(");
            for (int j = 1; j < i + 1; j++) {
                if (j < i) {
                    System.out.print(j + "!+");
                } else {
                    System.out.print(j + "!)");
                }
            }
            if (i < b) {
                System.out.print("+");
            } else {
                System.out.println("所以");
            }

        }double c = 0;
        for (int i = 0; i < b; i++) {
            c = Math.pow(4,b-1);
        }

        System.out.println("用户输入进行阶乘后答案为:" +c);
    }
    }


